﻿<div class="row" data-ng-controller="locationDetailCtrl">
    <div id="loadingWidget" class="row-fluid ui-corner-all" style="padding: 0 .7em;" loading-widget>
        <div class="loadingContent">
            <p>
                <img alt="Loading  Content" src="images/ajax-loader.gif" />&nbsp;Loading
            </p>
        </div>
    </div>
    <div class="row">
        <br />
    </div>
    <div class="row">
        <br />
    </div>
    <div class="panel panel-primary" title="Location Info">
        <div class="panel-heading">
            <h3 class="panel-title">Location - {{location.street}} ,  {{location.city}}</h3>
        </div>
        <div class="container">

            <form name="form" class="form-horizontal" role="form" onshow="toggleSelection(hazard,true)"   data-ng-onchange="checksave">
                <div class="form-group">
                    <label title="Start Time" for="starttime" class="col-md-2">Start Time </label>
                    <div class="col-md-3">
                        <div class="input-group">
                            <input type="text" id="starttime" date-time ng-model="location.startTime" required="true" view="minutes" class="form-control" />
                            <span class=" input-group-addon glyphicon glyphicon-time"></span>
                        </div>
                    </div>

                    <label title="End Time" class="col-md-2" for="endtime">End Time</label>

                    <div class="col-md-3">
                        <div class="input-group">
                            <input type="text" date-time ng-model="location.endTime" required="true" view="minutes" id="endtime" class="form-control" />
                            <span class=" input-group-addon glyphicon glyphicon-time"></span>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label title="type of building" class="col-md-2" for="">Type</label>
                    <div class="col-md-10">
                        <div class="input-group">
                            <label class="radio-inline" title="location type" data-ng-repeat="type in locationtype">
                                <input type="radio" name="locationTypeId" data-ng-model="$parent.location.locationTypeId" value="{{type.lookupID}}">{{type.title}}
                            </label>
                        </div>
                    </div>
                </div>


                <!--http://odetocode.com/blogs/scott/archive/2013/06/25/radio-buttons-with-angularjs.aspx-->
                <div class="form-group">
                    <label title="condition of building" class="col-md-2" for="">Condition</label>
                    <div class="col-md-10">

                        <label class="radio-inline" title="location status" data-ng-repeat="statusloc in locationStatus">
                            <input type="radio" name="locationStatus_LookupID" data-ng-model="$parent.location.locationStatus_LookupID" value="{{statusloc.lookupID}}" >{{statusloc.title}}
                        </label>
                    </div>

                </div>


                <div class="form-group" >
                    <label title="address of building" class="col-md-2" for="">Address</label>
                    <div class="col-md-4">
                        <label class="sr-only" for="street">Street</label>
                        <input type="text" title="street" id="street" data-ng-model="location.street" placeholder="Street" class="form-control" />
                    </div>
                    <div class="col-md-3">
                        <label class="sr-only" for="city">City</label>
                        <input type="text" title="city" id="city" data-ng-model="location.city" placeholder="City" class="form-control" />
                    </div>
                    <div class="col-md-2">
                        <label class="sr-only" for="city">City</label>
                        <input type="text" title="zip code" id="zip code" data-ng-model="location.zip" placeholder="ZipCode" class="form-control" />
                    </div>

                </div>

                <div class="form-group">
                    <div class="col-md-2"></div>
                    <label title="address of building" class="col-md-2" for="">Geo Location</label>
                    <div class="form-group">
                        <input type="hidden" data-ng-data-model="location.id" />
                        <div class="col-md-2 ">
                            <label class="sr-only" for="latitude">Latitude</label>
                            <input type="text" id="latitude" title="latitude" data-ng-model="location.geoLocationLat" class="form-control" />
                        </div>
                        <div class="col-md-2">
                            <label class="sr-only" for="longitude">Latitude</label>
                            <input type="text" id="longitude" title="longitude" data-ng-model="location.geoLocationLong" class="form-control" />
                        </div>
                        <div class="col-md-2">
                            <button type="button" class="btn btn-primary" id="GetGeo" title="Geo Loc" data-ng-click="codeAddress()" value="Geo Loc">Geo Loc</button>
                        </div>
                    </div>

                </div>
                <div class="form-group" >
                    <label title="building hazards" class="col-md-2" for="">Hazards</label>
                    <div class="col-md-10">

                        <!--  <label class="checkbox-inline" title="hazards" data-ng-repeat="hazard in hazards">-->
                        <!--  <select ui-select2 onchange="toggleSelection(hazard,true)" onshow="toggleSelection(hazard,true)"  multiple data-ng-model="location.locationHazards" data-placeholder="select hazards" style="width: 929px; height: 46px" >
    <option value=""></option>
    <option ng-repeat="hazard in hazards" value="{{hazard.lookupID}}">{{hazard.title}}</option>
</select>
                          data-ng-changed="toggleSelection(hazard,this)"
                          ng-model="$parent.$parent.location"-->
                        <div class="form-group">
                            <span data-ng-repeat="hazard in hazards" class="checkbox-inline">
                                <input name="hazard" type="checkbox"  my-checkbox-group value="{{harzard.lookupID}}" fieldobj="hazard.lookupID" data-ng-click="checksave()"  destarray='$parent.$parent.location.locationHazards'>
                                {{hazard.title}}<br />
                            </span>

                        </div>
                    </div>
                </div>
                <button class="btn btn-primary" title="editSave" data-ng-click="updateLocation(location)" id="buttonSave" type="submit" data-ng-disabled="form.$pristine || form.$invalid"">
                    Save</button>
            </form>

            <div class="row">
                <div class="col-md-6 col-md-offset-3 text-center">
                    <a class="btn-lg btn-primary  btn-block text-center" title="show victims" href="#/Victims/{{location.id}}" id="victimsbutton">Victims</a>
                </div>
            </div>

        </div>
    </div>
</div>
